from typing import Optional, List
from datetime import datetime
from pydantic import BaseModel

class AirTicketBase(BaseModel):
    OrderId: int
    FlightNo: str
    DepartureAirportCode: str
    ArrivalAirportCode: str
    DepartureTime: datetime
    ArrivalTime: datetime
    PlaneModel: str
    TicketPrice: float
    TaxPrice: float
    Status: str

    class Config:
        from_attributes = True

class AirTicketCreate(AirTicketBase):
    pass

class AirTicket(AirTicketBase):
    TicketId: int
    WorkAreaId: int
    CreateTime: datetime
    UpdateTime: Optional[datetime] = None

    class Config:
        from_attributes = True

class AirTicketPassenger(BaseModel):
    TicketId: int
    PassengerId: int
    SeatNo: Optional[str] = None
    TicketNo: Optional[str] = None
    Status: str

    class Config:
        from_attributes = True 